var lastMinute = 61;
var lastDay = new Date();

function clock_Start()
{
	clock_Second();
}

function clock_Second(caption)
{
	var myDate = new Date();
	if(myDate.getDay()!=lastDay.getDay())
	{
		calendar_Aux(curDate.getMonth(), curDate.getFullYear());
		setTimeout('clock_Second()', 1000);
	}
	var html='';
	html += (myDate.getHours() < 10 ? '0' + myDate.getHours() : myDate.getHours());
	html += ':';
	html += (myDate.getMinutes() < 10 ? '0' + myDate.getMinutes() : myDate.getMinutes());
	html += ':';
	html += (myDate.getSeconds() < 10 ? '0' + myDate.getSeconds() : myDate.getSeconds());
	document.getElementById('clock_date').innerHTML=html;
	if(lastMinute!=myDate.getMinutes())
	{
		clock_Minute();
		clock_Hour();
	}
	lastMinute=myDate.getMinutes();
	setTimeout('clock_Second()', 1000);
}

function clock_Minute()
{
	var myDate = new Date();
	document.getElementById('clock_minutes').src=baseAddress + 'img/clock_minute/'+(myDate.getMinutes() < 10 ? '0' + myDate.getMinutes() : myDate.getMinutes()) + '.png';
}

function clock_Hour()
{
	var myDate = new Date();
	var disp = 5 * (myDate.getHours() % 12);
	disp += Math.floor(myDate.getMinutes() / 12);
	document.getElementById('clock_hours').src=baseAddress + 'img/clock_hour/'+(disp < 10 ? '0' + disp : disp) + '.png';
}
